package com.etc.entity;


import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 订单实体类
 * @author 赵伟伟
 */
@Component
public class Orders {

    /**订单编号*/
    private String o_id;

    /**订单描述*/
    private String o_title;

    /**商品数量*/
    private Integer o_num;

    /**商品总价*/
    private Double total_fee;

    /**商品图片*/
    private String o_img;

    /**商品状态*/
    private Integer o_status;

    /**下单时间*/
    private String o_data;

    /**关系映射：一个订单对应多个商品*/
    private List<Books> booksList;


    public Orders(String o_id, String o_title, Integer o_num, Double total_fee, String o_img, Integer o_status, String o_data, List<Books> booksList) {
        this.o_id = o_id;
        this.o_title = o_title;
        this.o_num = o_num;
        this.total_fee = total_fee;
        this.o_img = o_img;
        this.o_status = o_status;
        this.o_data = o_data;
        this.booksList = booksList;
    }

    public Orders(String o_title, Integer o_num, Double total_fee, String o_img, Integer o_status, String o_data, List<Books> booksList) {
        this.o_title = o_title;
        this.o_num = o_num;
        this.total_fee = total_fee;
        this.o_img = o_img;
        this.o_status = o_status;
        this.o_data = o_data;
        this.booksList = booksList;
    }

    public Orders(String o_id, String o_title, Integer o_num, Double total_fee, String o_data, List<Books> booksList) {
        this.o_id = o_id;
        this.o_title = o_title;
        this.o_num = o_num;
        this.total_fee = total_fee;
        this.o_data = o_data;
        this.booksList = booksList;
    }

    public Orders() {
    }

    @Override
    public String toString() {
        return "Order{" +
                "o_id='" + o_id + '\'' +
                ", o_title='" + o_title + '\'' +
                ", o_num=" + o_num +
                ", total_fee=" + total_fee +
                ", o_img='" + o_img + '\'' +
                ", o_status=" + o_status +
                ", o_data='" + o_data + '\'' +
                ", booksList=" + booksList +
                '}';
    }
}
